﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NCT.MRS.DataAccessLayer.Entities;

namespace NCT.MRS.DataAccessLayer.Configurations
{
    public class AccessTypeConfiguration : EntityTypeConfiguration<AccessType>
    {
        public AccessTypeConfiguration()
        {
            HasKey(P => P.Id);

            Property(P => P.Name).IsRequired().HasMaxLength(30);
            Property(P => P.Description).IsOptional().HasMaxLength(100);
            Property(P => P.Code).IsRequired().HasMaxLength(30);

            HasMany(P => P.Roles).WithMany(P => P.AccessTypes);
        }
    }
}
